package com.lc.studymybatis.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lc.studymybatis.entity.User;
import com.lc.studymybatis.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    @Autowired
    UserMapper userMapper;

    public PageInfo getUser() {

        PageHelper.startPage(1, 5);

        List<User> user = userMapper.getUser();
        PageInfo<User> userPageInfo = new PageInfo<>(user);

        return userPageInfo;
    }
}
